package com.kim.androidbase.db;

import java.util.List;

public interface DAO<T, PK> {

	/**
	 * 泛型参数个数
	 */
	public static final int GENERICITY = 2;

	/**
	 * add entity
	 * 
	 * @param t
	 */
	public void add(T t);

	/**
	 * add entities in transaction
	 * 
	 * @param ts
	 */
	public void add(List<T> ts);

	/**
	 * delete entity by PK
	 * 
	 * @param pk
	 */
	public void delete(PK pk);

	/**
	 * delete entities by criteria
	 * 
	 * @param sqLiteCriteria
	 */
	public void delete(SQLiteCriteria sqLiteCriteria);

	/**
	 * modify entity by criteria
	 * 
	 * @param sqLiteCriteria
	 */
	public void modify(SQLiteCriteria sqLiteCriteria);

	/**
	 * modify entities by criteria and PK
	 * 
	 * @param pk
	 * @param sqLiteCriteria
	 */
	public void modify(PK pk, SQLiteCriteria sqLiteCriteria);

	/**
	 * query entity by PK
	 * 
	 * @param pk
	 * @return
	 */
	public T query(PK pk);

	/**
	 * query entities by criteria
	 * 
	 * @param sqLiteCriteria
	 * @return
	 */
	public List<T> query(SQLiteCriteria sqLiteCriteria);

}
